<template>
  <l-content :app="app" width="1500px" v-loading="loading">
    <el-form inline size="mini" label-width="120px" :model="form" ref="form">
      <el-card class="card-bottom-spacing">
        <div slot="header" class="card-title">
          订单信息
        </div>
        <div>
          <el-form-item label="订单来源">
            <el-select v-model="form.shopCode" class="w200">
              <el-option v-for="item in options.shop" :key="item.shopNo" :value="item.shopNo" :label="item.shopName"/>
            </el-select>
          </el-form-item>

          <el-form-item label="网店出票单号">
            <el-input v-model="form.issueBillId" class="w200"/>
          </el-form-item>
          <el-form-item label="关联订单号">
            <el-input v-model="form.relaOrderId" class="w200"/>
          </el-form-item>
        </div>
        <div>
          <el-form-item label="PNR">
            <el-input v-model="form.recordNo" class="w200"/>
          </el-form-item>
          <el-form-item label="大编码">
            <el-input v-model="form.airlineRecordNo" class="w200"/>
          </el-form-item>
          <el-form-item label="政策代码">
            <el-input v-model="form.policyCode" class="w200"/>
          </el-form-item>
          <el-form-item label="预订员">
            <el-select v-model="form.issueUser" class="w200">
              <el-option v-for="item in options.issueUser" :key="item.key" :value="item.key" :label="item.value"/>
            </el-select>
          </el-form-item>
        </div>
        <div>

        </div>
      </el-card>

      <el-card class="card-bottom-spacing">
        <div slot="header" class="card-title">
          <span>行程信息</span>
          <el-button style="margin-left: 40px" size="mini" type="primary" @click="onAddTripInfo">
            新增
          </el-button>
        </div>
        <el-table
          border
          class="el-easy-ui-table"
          :data="form.tripInfoList"
        >
          <el-table-column
            label="序号"
            type="index"
            width="50">
          </el-table-column>
          <el-table-column
            label="航班号"
            width="140">
            <template slot-scope="scope">
              <el-form-item>
                <el-input v-model="scope.row.flight"/>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column
            label="出发地/机场三字码"
            min-width="240">
            <template slot-scope="scope">
                <el-input size="mini" v-model="scope.row.dPortStr" class="w160"/>
                <el-input size="mini" v-model="scope.row.dPort" class="w60"/>
            </template>
          </el-table-column>
          <el-table-column
            label="目的地/机场三字码"
            min-width="240">
            <template slot-scope="scope">
              <el-input size="mini" v-model="scope.row.aPortStr" class="w160"/>
              <el-input size="mini" v-model="scope.row.aPort" class="w60"/>
            </template>
          </el-table-column>
          <el-table-column
            label="舱位"
            width="80">
            <template slot-scope="scope">
              <el-input v-model="scope.row.clazz" size="mini"/>
            </template>
          </el-table-column>
          <el-table-column
            label="出发日期/时间"
            width="200">
            <template slot-scope="scope">
              <el-form-item>
                <c-datetime-picker
                  value-format="yyyy-MM-dd hh:mm:ss"
                  v-model="scope.row.takeOffTime"
                  time-format="HH:mm"/>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column
            label="到达日期/时间"
            width="200">
            <template slot-scope="scope">
              <el-form-item>
                <c-datetime-picker
                  value-format="yyyy-MM-dd hh:mm:ss"
                  v-model="scope.row.arrivalTime"
                  time-format="HH:mm"/>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
            min-width="160">
            <template slot-scope="scope">
              <el-button type="text" @click="form.tripInfoList.splice(scope.$index, 1)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-card>

      <el-card class="card-bottom-spacing">
        <div slot="header" class="card-title">
          乘机人信息
          <el-button style="margin-left: 40px" size="mini" type="primary" @click="onAddPassenger">
            新增
          </el-button>
        </div>
        <el-table
          :summary-method="getSummaries"
          :data="form.passengerList"
          border
          show-summary
          class="el-easy-ui-table">
          <el-table-column
            label="序号"
            type="index"
            width="50">
          </el-table-column>
          <el-table-column
            label="乘机人"
            width="160">
            <template slot-scope="scope">
              <el-form-item :prop="'passengerList[' + scope.$index + '].ageType'"
                            :rules="rules.ageType"
                            style="margin-right: 0;">
                <el-select v-model="scope.row.ageType" class="w60" size="mini">
                  <el-option label="成" value="ADU"/>
                  <el-option label="童" value="CHI"/>
                  <el-option label="婴" value="BAB"/>
                </el-select>
              </el-form-item>
              <el-form-item :prop="'passengerList[' + scope.$index + '].passengerName'"
                            :rules="rules.passengerName"
                            style="margin-right: 0;">
                <el-input v-model="scope.row.passengerName" class="w80" size="mini"/>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column
            label="证件号"
            width="150">
            <template slot-scope="scope">
              <el-form-item :prop="'passengerList[' + scope.$index + '].cardNo'"
                            :rules="rules.cardNo"
                            style="margin-right: 0;">
                <el-input v-model="scope.row.cardNo" size="mini"/>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column
            label="手机号"
            width="100">
            <template slot-scope="scope">
              <el-input v-model="scope.row.passengerMobile" size="mini"/>
            </template>
          </el-table-column>
          <el-table-column
            prop="purchasePrintPrice"
            label="采购票面价"
            width="90">
            <template slot-scope="scope">
              <el-input size="mini" :value="scope.row.purchasePrintPrice" @input="v => {
              scope.row.purchasePrintPrice = v
              scope.row.purchasePrice = v ? fixed2(v * (1 - (scope.row.agencyRate||0))):''
              scope.row.issueProfit = v? fixed2(scope.row.salePrice - scope.row.purchasePrice):''
            }"/>
            </template>
            <el-input></el-input>
          </el-table-column>
          <el-table-column
            label="代理费率"
            width="80">
            <template slot-scope="scope">
              <c-percent-input size="mini" :value="scope.row.agencyRate" @input="v => {
              scope.row.agencyRate = v
              scope.row.agencyFixedFee = v ? fixed2(parseFloat(v) * scope.row.purchasePrintPrice) : ''
              scope.row.purchasePrice = fixed2(scope.row.purchasePrintPrice - (scope.row.agencyFixedFee||0))
              scope.row.issueProfit = fixed2(scope.row.salePrice - scope.row.purchasePrice)
            }"/>
            </template>
          </el-table-column>
          <el-table-column
            label="代理费"
            width="60">
            <template slot-scope="scope">
              <el-input size="mini" :value="scope.row.agencyFixedFee" @input="v => {
              scope.row.agencyFixedFee = v
              scope.row.agencyRate = v ? fixed4(v / scope.row.purchasePrintPrice) : ''
              scope.row.purchasePrice = fixed2(scope.row.purchasePrintPrice - (scope.row.agencyFixedFee||0))
              scope.row.issueProfit = fixed2(scope.row.salePrice - scope.row.purchasePrice)
            }"/>
            </template>
          </el-table-column>
          <el-table-column
            label="采购价"
            width="70">
            <template slot-scope="scope">
              <el-input size="mini" :value="scope.row.purchasePrice" @input="v => {
              scope.row.purchasePrice = v
              scope.row.agencyFixedFee = v?fixed2(scope.row.purchasePrintPrice - v):''
              scope.row.agencyRate = v?fixed4(scope.row.agencyFixedFee / scope.row.purchasePrintPrice) : ''
              scope.row.issueProfit = v?fixed2((scope.row.salePrice||0) - (scope.row.purchasePrice||0)) : ''
            }"/>
            </template>
          </el-table-column>
          <el-table-column
            label="让利"
            width="60">
            <template slot-scope="scope">
              <el-input v-model="scope.row.saleProfit" size="mini"/>
            </template>
          </el-table-column>
          <el-table-column
            label="销售价"
            width="70">
            <template slot-scope="scope">
              <el-input :value="scope.row.salePrice" size="mini" @input="v => {
              scope.row.salePrice = v
              scope.row.saleTotalPrice = v?fixed2(+(scope.row.salePrice||0) + (+(scope.row.tax||0)) + (+(scope.row.oilFee||0))):''
              scope.row.issueProfit = v?fixed2((scope.row.salePrice||0) - (scope.row.purchasePrice||0)):''
            }"/>
            </template>
          </el-table-column>
          <el-table-column
            prop="tax"
            label="税+费"
            width="140">
            <template slot-scope="scope">
              <el-input :value="scope.row.tax" size="mini" class="w60" @input="v => {
              scope.row.tax = v
              scope.row.saleTotalPrice = v?fixed2(+(scope.row.salePrice||0) + (+(scope.row.tax||0)) + (+(scope.row.oilFee||0))):''
            }"/>
              <el-input :value="scope.row.oilFee" size="mini" class="w60" @input="v => {
              scope.row.oilFee = v
              scope.row.saleTotalPrice = v?fixed2(+(scope.row.salePrice||0) + (+(scope.row.tax||0)) + (+(scope.row.oilFee||0))):''
            }"/>
            </template>
          </el-table-column>
          <el-table-column
            prop="issueProfit"
            label="出票利润"
            width="80">
          </el-table-column>
          <el-table-column
            prop="saleTotalPrice"
            label="应收金额"
            width="80">
          </el-table-column>
          <el-table-column
            prop="ticketNo"
            label="票号"
            min-width="140">
            <template slot-scope="scope">
              <el-input placeholder="xxx-xxxxxxxxxx" v-model="scope.row.ticketNo" size="mini"/>
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
            min-width="100">
            <template slot-scope="scope">
              <el-button type="text" @click="form.passengerList.splice(scope.$index, 1)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-card>

      <!--<el-card class="card-bottom-spacing">-->
        <!--<div slot="header" class="card-title">-->
          <!--收款信息-->
          <!--<el-button style="margin-left: 40px" size="mini" type="primary" @click="onAddReceivables">-->
            <!--新增-->
          <!--</el-button>-->
        <!--</div>-->
        <!--<el-table-->
          <!--:data="form.receivablesList"-->
          <!--border-->
          <!--class="el-easy-ui-table">-->
          <!--<el-table-column-->
            <!--label="序号"-->
            <!--type="index"-->
            <!--width="50">-->
          <!--</el-table-column>-->
          <!--<el-table-column-->
            <!--prop="busiType"-->
            <!--label="业务"-->
            <!--width="80">-->
            <!--<template slot-scope="scope">-->
              <!--<el-input v-model="scope.row.busiType" size="mini"/>-->
            <!--</template>-->
          <!--</el-table-column>-->
          <!--<el-table-column-->
            <!--label="操作类型"-->
            <!--width="80">-->
            <!--<template slot-scope="scope">-->
              <!--<el-input v-model="scope.row.operType" size="mini"/>-->
            <!--</template>-->
          <!--</el-table-column>-->
          <!--<el-table-column-->
            <!--label="收款方式"-->
            <!--width="80">-->
            <!--<template slot-scope="scope">-->
              <!--<el-input v-model="scope.row.receivablesWay" size="mini"/>-->
            <!--</template>-->
          <!--</el-table-column>-->
          <!--<el-table-column-->
            <!--prop="receivablesItem"-->
            <!--label="收款科目"-->
            <!--width="80">-->
          <!--</el-table-column>-->
          <!--<el-table-column-->
            <!--prop="amount"-->
            <!--label="收款金额"-->
            <!--width="100">-->
            <!--<template slot-scope="scope">-->
              <!--<el-input v-model="scope.row.amount" size="mini"/>-->
            <!--</template>-->
          <!--</el-table-column>-->
          <!--<el-table-column-->
            <!--prop="payNo"-->
            <!--label="支付流水"-->
            <!--width="120">-->
            <!--<template slot-scope="scope">-->
              <!--<el-input v-model="scope.row.payNo" size="mini"/>-->
            <!--</template>-->
          <!--</el-table-column>-->
          <!--<el-table-column-->
            <!--prop="cashier"-->
            <!--label="收银员"-->
            <!--width="100">-->
            <!--<template slot-scope="scope">-->
              <!--<el-select v-model="form.cashier" size="mini">-->
                <!--<el-option v-for="item in options.issueUser" :key="item.key" :value="item.key" :label="item.value"/>-->
              <!--</el-select>-->
            <!--</template>-->
          <!--</el-table-column>-->
          <!--<el-table-column-->
            <!--label="收款时间"-->
            <!--width="180">-->
            <!--<template slot-scope="scope">-->
              <!--<el-date-picker-->
                <!--size="mini"-->
                <!--style="width: 100%"-->
                <!--v-model="scope.row.receivablesTime"-->
                <!--type="datetime"-->
                <!--placeholder="选择日期时间">-->
              <!--</el-date-picker>-->
            <!--</template>-->
          <!--</el-table-column>-->
          <!--<el-table-column-->
            <!--prop="remark"-->
            <!--label="备注"-->
            <!--min-width="200">-->
            <!--<template slot-scope="scope">-->
              <!--<el-input v-model="scope.row.remark" size="mini"/>-->
            <!--</template>-->
          <!--</el-table-column>-->
          <!--<el-table-column-->
            <!--label="操作"-->
            <!--width="150">-->
            <!--<template slot-scope="scope">-->
              <!--<el-button type="text" @click="form.receivablesList.splice(scope.$index, 1)">删除</el-button>-->
            <!--</template>-->
          <!--</el-table-column>-->
        <!--</el-table>-->
      <!--</el-card>-->

      <el-card class="card-bottom-spacing">
        <div slot="header" class="card-title">
          客户联系方式
        </div>
        <el-form size="mini" inline>
          <el-form-item label="姓名">
            <el-input v-model="form.contactPerson" class="w160"/>
          </el-form-item>
          <el-form-item label="联系电话" label-width="120px">
            <el-input v-model="form.contactNumber" class="w160"/>
          </el-form-item>
          <el-form-item label="邮箱" label-width="120px">
            <el-input v-model="form.contactEmail" class="w160"/>
          </el-form-item>
        </el-form>
      </el-card>

      <el-card class="card-bottom-spacing">
        <div slot="header" class="card-title">
          备注
        </div>
        <div>
          <el-form-item label="备注" label-width="60px">
            <el-input
              v-model="form.issueRemark"
              style="width: 1000px"
              type="textarea"
              :autosize="{ minRows: 4, maxRows: 8}"
            >
            </el-input>
          </el-form-item>
        </div>
      </el-card>

      <el-card class="card-bottom-spacing">
        <div style="text-align: center">
          <easy-button type="warning" @click="onSaveOrder" class="w150">保存</easy-button>
        </div>
      </el-card>
    </el-form>
  </l-content>
</template>

<script>
import Dict from '@/constants/Dict'
import Tab from '@/classes/Tab'

export default {
  name: 'OrderSupplementDetail',
  props: {
    app: {
      type: Object,
      default () {
        return {
          extra: {
            detail: ''
          }
        }
      }
    }
  },
  data () {
    return {
      activeTicketTab: 'online',
      options: {
        shop: [],
        issueChannel: Dict.getOptions('issueChannel', ['B2B', 'BSP', 'B2C']),
        payWay: [],
        issueUser: [],
        issueType: [],
        officeNo: Dict.Options.officeNo
      },
      operator: {
        issueTicket: true
      },
      loading: false,
      checked: false,
      value: '',
      offlineIssue: {
        purchasePrintPrice: '',
        agencyRate: '',
        agencyFixedFee: ''
      },
      dialog: {
        tag: '',
        data: {}
      },
      form: {
        currOperator: null,
        canLock: null,
        localOrderId: null,
        adtk: null,
        policyTypeStr: null,
        airlineRecordNo: null,
        cancelIssueStatus: null,
        dataChangeCreater: null,
        dataChangeCreateTime: null,
        dataChangeLastTime: null,
        eiRemark: null,
        extOrderId: null,
        flightClass: null,
        issueBillId: null,
        issueRemark: null,
        issueStatus: null,
        lastPrintTicketTime: null,
        officeNo: null,
        orderDate: null,
        policyCode: null,
        policyId: null,
        policyType: null,
        recordNo: null,
        ticketType: null,
        urgency: null,
        urgeTimes: null,
        saleType: null,
        issueBillAssignOperator: null,
        intlRebookOrder: null,
        isVip: null,
        flightAgency: null,
        loadAccount: null,
        tbookingDatetime: null,
        realReservationType: null,
        currencyType: null,
        customerId: null,
        eEiRemark: null,
        specialCode: null,
        ownerAirline: null,
        fareBasis: null,
        ctripRcRule: null,
        flightWay: null,
        orderSource: null,
        shopName: null,
        shopCode: null,
        bookWay: null,
        bookWayStr: null,
        pnrText: null,
        oldPnr: null,
        lockOperator: null,
        lockTime: null,
        contactPerson: null,
        contactNumber: null,
        contactEmail: null,
        issueUser: null,
        issueTime: null,
        issueChannel: null,
        issueType: null,
        issueWay: null,
        protocolNo: null,
        payWay: null,
        payNo: null,
        airlineOrderId: null,
        agencyRate: null,
        totalPurchase: null,
        orderStatus: null,
        relaOrderId: null,
        updateTime: null,
        createTime: null,
        updateUser: null,
        createUser: null,
        tripInfoList: [],
        passengerList: [],
        receivablesList: []
      },
      orderLog: [],
      rules: {
        ageType: this.$checkRules.orderSupplementDetail.ageType,
        passengerName: this.$checkRules.orderSupplementDetail.passengerName,
        cardNo: this.$checkRules.orderSupplementDetail.cardNo
      }
    }
  },
  computed: {
    totalPurchase () {
      return this.fixed2((+this.passengerListTotal[3]) + (+this.passengerListTotal[6]))
    },
    issueChannel () {
      const item = Dict.Map.issueChannel[this.form.issueChannel]
      return item ? item.code : ''
    },
    passengerListTotal () {
      const list = this.form.passengerList
      const purchasePrintPrice = list.reduce((sum, i) => {
        return sum + (parseFloat(i.purchasePrintPrice || 0) || 0)
      }, 0)
      const agencyFixedFee = list.reduce((sum, i) => {
        return sum + (parseFloat(i.agencyFixedFee || 0) || 0)
      }, 0)
      const purchasePrice = list.reduce((sum, i) => {
        return sum + (parseFloat(i.purchasePrice || 0) || 0)
      }, 0)
      const saleProfit = list.reduce((sum, i) => {
        return sum + (parseFloat(i.saleProfit || 0) || 0)
      }, 0)
      const salePrice = list.reduce((sum, i) => {
        return sum + (parseFloat(i.salePrice || 0) || 0)
      }, 0)
      const taxAndOilFee = list.reduce((sum, i) => {
        return sum + (parseFloat(i.tax || 0) || 0) + (parseFloat(i.oilFee || 0) || 0)
      }, 0)
      // const serviceFee = list.reduce((sum, i) => {
      //   return sum + (parseFloat(i.serviceFee || 0) || 0)
      // }, 0)
      // const insuranceFee = list.reduce((sum, i) => {
      //   return sum + (parseFloat(i.insuranceFee || 0) || 0)
      // }, 0)
      const issueProfit = list.reduce((sum, i) => {
        return sum + (parseFloat(i.issueProfit || 0) || 0)
      }, 0)
      const saleTotalPrice = list.reduce((sum, i) => {
        return sum + (parseFloat(i.saleTotalPrice || 0) || 0)
      }, 0)
      const fixed2 = this.fixed2
      return [fixed2(purchasePrintPrice), '', fixed2(agencyFixedFee), fixed2(purchasePrice), fixed2(saleProfit), fixed2(salePrice), fixed2(taxAndOilFee), fixed2(issueProfit), fixed2(saleTotalPrice)]
    }
  },
  filters: {
    cabinFilter (v) {
      const map = {
        F: '-头等舱',
        C: '-公务舱',
        Y: '-经济舱'
      }
      return map[v] || ''
    },
    leaveTimeFilter (val) {
      const minute = (val - new Date().getTime()) / 60 / 1000
      if (minute < 0) {
        return '已过期'
      } else if (minute < 60) {
        return minute.toFixed(0) + '分钟'
      } else if (minute < 60 * 24) {
        return (minute / 60).toFixed(0) + '小时'
      } else {
        return (minute / 24 / 60).toFixed(0) + '天'
      }
    },
    lockTimeFilter (v) {
      const minute = (new Date().getTime() - v) / 60 / 1000
      if (minute < 60) {
        return minute.toFixed(0) + '分钟'
      } else if (minute < 60 * 24) {
        return (minute / 60).toFixed(0) + '小时'
      } else {
        return (minute / 24 / 60).toFixed(0) + '天'
      }
    }
  },
  created () {
    Object.assign(this.form, this.app.extra.detail)
    this.form.issueUser = this.form.currOperator
    this.loadOptions()
  },
  methods: {
    onAddTripInfo () {
      this.form.tripInfoList.push({
        sequence: '',
        takeOffTime: null,
        dCity: '',
        dCityStr: '',
        dPort: '',
        dPortStr: '',
        arrivalTime: null,
        aCity: '',
        aCityStr: '',
        aPort: '',
        aPortStr: '',
        flight: '',
        clazz: '',
        subClass: ''
      })
    },
    onAddPassenger () {
      this.form.passengerList.push({
        oilFee: 10,
        ageType: 'ADU',
        passengerName: '',
        birthDate: null,
        cardNo: '',
        cardType: null,
        cardTypeStr: null,
        passengerMobile: '',
        printPrice: '',
        purchasePrintPrice: '',
        agencyRate: '',
        agencyFixedFee: '',
        purchasePrice: '',
        saleProfit: '',
        salePrice: '',
        tax: '',
        serviceFee: '',
        insuranceFee: '',
        issueProfit: '',
        saleTotalPrice: '',
        ticketNo: ''
      })
    },
    onAddReceivables () {
      this.form.receivablesList.push({
        id: null,
        localOrderId: null,
        busiType: '',
        operType: '',
        receivablesWay: '',
        receivablesItem: '',
        amount: '',
        payNo: '',
        cashier: '',
        receivablesTime: '',
        remark: null
      })
    },
    onInputPurchasePrintPrice (v) {
      this.offlineIssue.purchasePrintPrice = v
      // 改变列表中的值
      this.form.passengerList.forEach(item => {
        item.purchasePrintPrice = v
        item.purchasePrice = v ? this.fixed2(v * (1 - (item.agencyRate || 0))) : ''
        item.issueProfit = v ? this.fixed2(item.salePrice - item.purchasePrice) : ''
      })
    },
    onInputAgencyRate (v) {
      const fixed2 = this.fixed2
      this.offlineIssue.agencyRate = v
      this.form.passengerList.forEach(item => {
        item.agencyRate = v
        item.agencyFixedFee = v ? fixed2(parseFloat(v) * item.purchasePrintPrice) : ''
        item.purchasePrice = fixed2(item.purchasePrintPrice - (item.agencyFixedFee || 0))
        item.issueProfit = fixed2(item.salePrice - item.purchasePrice)
      })
    },
    onInputAgencyFixedFee (v) {
      const fixed2 = this.fixed2
      const fixed4 = this.fixed4
      this.offlineIssue.agencyFixedFee = v
      this.form.passengerList.forEach(item => {
        item.agencyFixedFee = v
        item.agencyRate = v ? fixed4(v / item.purchasePrintPrice) : ''
        item.purchasePrice = fixed2(item.purchasePrintPrice - (item.agencyFixedFee || 0))
        item.issueProfit = fixed2(item.salePrice - item.purchasePrice)
      })
    },
    loadOptions () {
      this.$service.options.getYeePayAccountType().then(res => {
        this.options.payWay = res.data
      })
      this.$service.airOnlineShop.loadIssueUserOption().then(res => {
        this.options.issueUser = res.data
      })
      this.$service.options.getSupply().then(res => {
        this.options.issueType = res.data
      })
      this.$service.order.queryAirOnlineShopList().then(res => {
        this.options.shop = res.data
      })
    },
    fixed2 (v) {
      return v ? ('' + (+v.toFixed(2))) : ''
    },
    fixed4 (v) {
      return v ? ('' + (+v.toFixed(4))) : ''
    },
    getSummaries (param) {
      const {columns} = param
      if (columns.length > 0) {
        columns[0].colSpan = 4
        return ['合计', ...this.passengerListTotal]
      }
    },
    onSaveOrder (done) { // 保存
      this.$refs['form'].validate(valid => {
        if (valid) {
          this.$confirm('是否确认保存？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            this.$service.order.supplementOrderSave(this.form).then(res => {
              this.$emit('changeApp', new Tab({
                key: 'airOrderManage.orderIssueDetail',
                name: '订单-' + res.data.localOrderId,
                extra: {localOrderId: res.data.localOrderId}
              }))
            }).finally(done)
          }).catch(done)
        } else {
          this.$alert('校验未通过', '提示')
          done()
        }
      })
    }
  }
}
</script>

<style></style>
